import React from 'react'
import { NavBar, Icon } from 'antd-mobile';
import styles from './header.less';

class Header extends React.Component {

  static defaultProps = {
    mode: 'dark',
    leftContent: '返回',
    leftClick: () => console.log('onLeftClick'),
    showBack: true,
    rightContent: null
  }


  render() {
    const {
      mode,leftContent,leftClick,showBack,rightContent,title
    } = this.props
    return (
      <div className={styles.navigator}>
        <NavBar
          mode={mode}
          icon={showBack ? <Icon type="left" size="lg" /> : ''}
          leftContent={leftContent}
          onLeftClick={leftClick}
          rightContent={rightContent}
        >
          {title}
        </NavBar>
      </div>
    )

  }
}
export default Header;

